package book;

public class BookList {

    private Book[] bookList = new Book[10];
    private int usedSize;//当前书架上有几本书

    public BookList(){
        this.bookList[0] = new Book("三国演义","罗贯中",18,"小说");
        this.bookList[1] = new Book("西游记","吴承恩",20,"小说");
        this.bookList[2] = new Book("红楼梦","曹雪芹",45,"小说");
        this.bookList[3] = new Book("水浒传","施耐庵",34,"小说");
        this.usedSize = 4;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
    //把书放到pos位置
    public void setBookList(int pos,Book book){
        bookList[pos] = book;
    }
    //获取pos位置的书
    public Book getBook(int pos){
        return bookList[pos];
    }
    //这里本质上可以写借阅书籍等操作

}
